/**
 *
 * @author Erivaldo Lourenco
 * @author Juliana Cavalcanti
 * 
 */

package br.ufal.ic.p3.Interface;


import br.ufal.ic.p3.Interface.cliente.CadastroCliente;
import br.ufal.ic.p3.Interface.cliente.juridico.CadastroClienteJuridico;
import br.ufal.ic.p3.Interface.funcionario.CadastroFuncionario;

import javax.swing.JDesktopPane;
import javax.swing.GroupLayout.Alignment;
import javax.swing.GroupLayout;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.JLabel;

import java.awt.Font;

import javax.swing.JButton;

import java.awt.SystemColor;

public class TelaPrincipal extends javax.swing.JFrame {

    public TelaPrincipal() {
        super("ProgNet - Tela Inicial"); 
        initComponents();
    }
    

    public JDesktopPane desktopPane;

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        logo = new javax.swing.JLabel();
        barraMenu = new javax.swing.JMenuBar();
        menuPrincipal = new javax.swing.JMenu();
        menuCadastrar = new javax.swing.JMenu();
        cadastroCliente = new javax.swing.JMenuItem();
        cadastroClienteJuridico = new javax.swing.JMenuItem();
        cadastroFuncionario = new javax.swing.JMenuItem();
        consultarCliente = new javax.swing.JMenu();
        consultaCliente = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setIconImages(null);

        logo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/ufal/ic/p3/imagens/ProgNet2.png"))); // NOI18N

        menuPrincipal.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/ufal/ic/p3/imagens/home.png"))); // NOI18N
        menuPrincipal.setText("Principal");
        menuPrincipal.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuPrincipalActionPerformed(evt);
            }
        });
        barraMenu.add(menuPrincipal);

        menuCadastrar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/ufal/ic/p3/imagens/cadastrar.png"))); // NOI18N
        menuCadastrar.setText("Cadastrar");
        menuCadastrar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuCadastrarActionPerformed(evt);
            }
        });

        cadastroCliente.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/ufal/ic/p3/imagens/cliente.png"))); // NOI18N
        cadastroCliente.setText("Cadastrar Cliente");
        cadastroCliente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cadastroClienteActionPerformed(evt);
            }
        });
        menuCadastrar.add(cadastroCliente);

        cadastroClienteJuridico.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/ufal/ic/p3/imagens/juridico.png"))); // NOI18N
        cadastroClienteJuridico.setText("Cadastrar Cliente Juridico");
        cadastroClienteJuridico.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cadastroClienteJuridicoActionPerformed(evt);
            }
        });
        menuCadastrar.add(cadastroClienteJuridico);

        cadastroFuncionario.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/ufal/ic/p3/imagens/funcionario.png"))); // NOI18N
        cadastroFuncionario.setText("Cadastrar Funcionario");
        cadastroFuncionario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cadastroFuncionarioActionPerformed(evt);
            }
        });
        menuCadastrar.add(cadastroFuncionario);

        barraMenu.add(menuCadastrar);

        consultarCliente.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/ufal/ic/p3/imagens/consultar.png"))); // NOI18N
        consultarCliente.setText("Consultar");

        consultaCliente.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/ufal/ic/p3/imagens/cliente.png"))); // NOI18N
        consultaCliente.setText("Consultar");
        consultaCliente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                consultaClienteActionPerformed(evt);
            }
        });
        consultarCliente.add(consultaCliente);

        barraMenu.add(consultarCliente);

        setJMenuBar(barraMenu);
        
        desktopPane = new JDesktopPane();
        desktopPane.setBackground(SystemColor.text);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        layout.setHorizontalGroup(
        	layout.createParallelGroup(Alignment.LEADING)
        		.addGroup(layout.createSequentialGroup()
        			.addGap(0, 607, Short.MAX_VALUE)
        			.addComponent(logo, GroupLayout.PREFERRED_SIZE, 263, GroupLayout.PREFERRED_SIZE))
        		.addGroup(layout.createSequentialGroup()
        			.addContainerGap()
        			.addComponent(desktopPane, GroupLayout.DEFAULT_SIZE, 846, Short.MAX_VALUE)
        			.addGap(12))
        );
        layout.setVerticalGroup(
        	layout.createParallelGroup(Alignment.TRAILING)
        		.addGroup(layout.createSequentialGroup()
        			.addComponent(desktopPane, GroupLayout.DEFAULT_SIZE, 545, Short.MAX_VALUE)
        			.addPreferredGap(ComponentPlacement.RELATED)
        			.addComponent(logo, GroupLayout.PREFERRED_SIZE, 71, GroupLayout.PREFERRED_SIZE))
        );
        getContentPane().setLayout(layout);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void menuCadastrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuCadastrarActionPerformed
        
    }//GEN-LAST:event_menuCadastrarActionPerformed

    private void cadastroClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cadastroClienteActionPerformed
    	CadastroCliente janelaCliente = new CadastroCliente();
        desktopPane.add(janelaCliente);
        janelaCliente.setVisible(true);
        janelaCliente.setSize(880, 520);
    }//GEN-LAST:event_cadastroClienteActionPerformed
                                               
    private void cadastroFuncionarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cadastroFuncionarioActionPerformed
    	CadastroFuncionario janelaFuncionario = new CadastroFuncionario();
        desktopPane.add(janelaFuncionario);
        janelaFuncionario.setVisible(true);
        janelaFuncionario.setSize(880, 520);
    }//GEN-LAST:event_cadastroFuncionarioActionPerformed

    private void menuPrincipalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuPrincipalActionPerformed
        TelaPrincipal janelaPrincipal = new TelaPrincipal();
        janelaPrincipal.setSize(872, 680);
        janelaPrincipal.setVisible(true);
    }//GEN-LAST:event_menuPrincipalActionPerformed

    private void consultaClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_consultaClienteActionPerformed
        Consulta janelaConsulta = new Consulta();
        desktopPane.add(janelaConsulta);
        janelaConsulta.setVisible(true);
        janelaConsulta.setSize(800, 600);
    }//GEN-LAST:event_consultaClienteActionPerformed

    private void cadastroClienteJuridicoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cadastroClienteJuridicoActionPerformed
        CadastroClienteJuridico janelaClienteJuridico = new CadastroClienteJuridico();
        desktopPane.add(janelaClienteJuridico);
        janelaClienteJuridico.setVisible(true);
        janelaClienteJuridico.setSize(880, 520);
    }//GEN-LAST:event_cadastroClienteJuridicoActionPerformed
    private javax.swing.JMenuBar barraMenu;
    private javax.swing.JMenuItem cadastroCliente;
    private javax.swing.JMenuItem cadastroClienteJuridico;
    private javax.swing.JMenuItem cadastroFuncionario;
    private javax.swing.JMenuItem consultaCliente;
    private javax.swing.JMenu consultarCliente;
    private javax.swing.JLabel logo;
    private javax.swing.JMenu menuCadastrar;
    private javax.swing.JMenu menuPrincipal;
    
}
